<script>
let reg = new RegExp('((ht|f)tps?:)\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]','g') 
let html = '我们都是好孩子'+
        ' www.baidu.com'+
        ' www.baidu.cn'+
        ' baidu.com'+
        ' http://www.baidu.com'+
        ' <img data-v-8d92fef6="" chinese="[微笑]" src="">'+
        '<img data-v-8d92fef6="" chinese="[猥琐]" src="">'+
        '<img data-v-8d92fef6="" chinese="[色情]" src="">'+
        '哈哈'
let newHtml = html.replace(reg,'<a href="$&" _target="blank">$&</a>')
console.log(newHtml);

</script>